$(function () {
    //热点图数据渲染
  $.ajax({
    url: BigNew.desk_hotpic,
    success(backData) {
      console.log(backData)
      $(".focus_list")
        .find("img")
        .each(function (i, ele) {
         let id = $(ele)
            .attr("src", backData.data[i].cover)
             .parent()
             .attr('href','./article.html?id='+backData.data[i].id)
            .next("p")
            .text(backData.data[i].title);
        });
    },
  });
    // 最新资讯文章数据渲染
  $.ajax({
    url: BigNew.desk_search,
    data: {
      // page:4
    },
    success(backData) {
      console.log(backData);
      let html = template('common-news', backData.data);
      $('.common_news').html(html);
    }
  });
  $.ajax({
    url: BigNew.desk_rank,
    success(backData) {
      let html = template('week_hot', backData);
      $('.hotrank_list').html(html);
    }
  });
  $.ajax({
    url: BigNew.desk_latest_comment,
    success(backData) {
     
      let html = template('new-comments', backData);
      $('.comment_list').html(html);
    }
  });
  
  $.ajax({
    url: BigNew.desk_attention,
    success(backData) {
    
      let html = template('attention', backData);
      $('.guanzhu_list').html(html);
    }
  });
 
});
